/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Shopping_panel.java
 *
 * Created on 23-05-2009, 10:39:40
 */

package VIEW;

import CONTROLLER.Controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import javax.swing.DefaultListModel;

/**
 *
 * @author Irene
 */
public class Shopping_panel extends javax.swing.JPanel implements Observer {
    private Controller ctrl;

    /** Creates new form Shopping_panel
     * @param ctrl
     */
    public Shopping_panel(Controller ctrl) {
        this.ctrl = ctrl;
        initComponents();
        ctrl.addObserver(this);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        mondayList = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        tuesdayList = new javax.swing.JList();
        jScrollPane3 = new javax.swing.JScrollPane();
        wednesdayList = new javax.swing.JList();
        jScrollPane4 = new javax.swing.JScrollPane();
        ThursdayList = new javax.swing.JList();
        jScrollPane5 = new javax.swing.JScrollPane();
        fridayList = new javax.swing.JList();
        jScrollPane6 = new javax.swing.JScrollPane();
        saturdayList = new javax.swing.JList();
        jScrollPane7 = new javax.swing.JScrollPane();
        sundayList = new javax.swing.JList();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        addMonday = new javax.swing.JButton();
        addWednesday = new javax.swing.JButton();
        addSunday = new javax.swing.JButton();
        addSaturday = new javax.swing.JButton();
        addFriday = new javax.swing.JButton();
        addThursday = new javax.swing.JButton();
        addTuesday = new javax.swing.JButton();
        deleteMonday = new javax.swing.JButton();
        deleteSaturday = new javax.swing.JButton();
        deleteSunday = new javax.swing.JButton();
        deleteFRrday = new javax.swing.JButton();
        deleteThursday = new javax.swing.JButton();
        deleteTuesday = new javax.swing.JButton();
        deleteWednesday = new javax.swing.JButton();
        jScrollPane8 = new javax.swing.JScrollPane();
        standardList = new javax.swing.JList();
        jLabel9 = new javax.swing.JLabel();
        addStandardList = new javax.swing.JButton();
        deleteStandard = new javax.swing.JButton();
        storeField = new javax.swing.JTextField();
        item1Field = new javax.swing.JTextField();
        item2Field = new javax.swing.JTextField();
        item3Field = new javax.swing.JTextField();
        item4Field = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        clearButton = new javax.swing.JButton();

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel1.setText("Shoppinglist");

        mondayList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(mondayList);

        tuesdayList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane2.setViewportView(tuesdayList);

        wednesdayList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane3.setViewportView(wednesdayList);

        ThursdayList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane4.setViewportView(ThursdayList);

        fridayList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane5.setViewportView(fridayList);

        saturdayList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane6.setViewportView(saturdayList);

        sundayList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane7.setViewportView(sundayList);

        jLabel2.setText("Monday");

        jLabel3.setText("Tuesday");

        jLabel4.setText("Wednesday");

        jLabel5.setText("Saturday");

        jLabel6.setText("Friday");

        jLabel7.setText("Thursday");

        jLabel8.setText("Sunday");

        addMonday.setText("Add To");
        addMonday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addMondayActionPerformed(evt);
            }
        });

        addWednesday.setText("Add To");
        addWednesday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addWednesdayActionPerformed(evt);
            }
        });

        addSunday.setText("Add To");
        addSunday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addSundayActionPerformed(evt);
            }
        });

        addSaturday.setText("Add To");
        addSaturday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addSaturdayActionPerformed(evt);
            }
        });

        addFriday.setText("Add To");
        addFriday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addFridayActionPerformed(evt);
            }
        });

        addThursday.setText("Add To");
        addThursday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addThursdayActionPerformed(evt);
            }
        });

        addTuesday.setText("Add To");
        addTuesday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addTuesdayActionPerformed(evt);
            }
        });

        deleteMonday.setText("Delete Item");
        deleteMonday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteMondayActionPerformed(evt);
            }
        });

        deleteSaturday.setText("Delete Item");
        deleteSaturday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteSaturdayActionPerformed(evt);
            }
        });

        deleteSunday.setText("Delete Item");
        deleteSunday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteSundayActionPerformed(evt);
            }
        });

        deleteFRrday.setText("Delete Item");
        deleteFRrday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteFRrdayActionPerformed(evt);
            }
        });

        deleteThursday.setText("Delete Item");
        deleteThursday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteThursdayActionPerformed(evt);
            }
        });

        deleteTuesday.setText("Delete Item");
        deleteTuesday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteTuesdayActionPerformed(evt);
            }
        });

        deleteWednesday.setText("Delete Item");
        deleteWednesday.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteWednesdayActionPerformed(evt);
            }
        });

        standardList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane8.setViewportView(standardList);

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel9.setText("Select Standard Item and add to weekday");

        addStandardList.setText("Add To Standardlist");
        addStandardList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStandardListActionPerformed(evt);
            }
        });

        deleteStandard.setText("Delete Item");
        deleteStandard.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteStandardActionPerformed(evt);
            }
        });

        storeField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                storeFieldActionPerformed(evt);
            }
        });

        jLabel10.setText("Store:");

        jLabel11.setText("Item 1");

        jLabel12.setText("Item 2");

        jLabel13.setText("Item 3");

        jLabel14.setText("Item 4");

        clearButton.setText("Clear");
        clearButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addGap(28, 28, 28)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel1)
                                        .addComponent(addMonday))
                                    .addGap(60, 60, 60)
                                    .addComponent(addTuesday))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addGap(10, 10, 10)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel10)
                                        .addComponent(jLabel12)
                                        .addComponent(jLabel13)
                                        .addComponent(jLabel14)
                                        .addComponent(jLabel11))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(item1Field, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                                        .addComponent(storeField)
                                        .addComponent(item2Field, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                                        .addComponent(item3Field, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                                        .addComponent(item4Field, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                                        .addComponent(clearButton, javax.swing.GroupLayout.Alignment.TRAILING))))
                            .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(deleteMonday)))
                                .addGap(26, 26, 26)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(deleteTuesday)))
                                .addGap(30, 30, 30)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(deleteWednesday))
                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(29, 29, 29)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(deleteThursday)))
                                .addGap(30, 30, 30)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(deleteFRrday)))
                                .addGap(26, 26, 26)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(deleteSaturday))
                                    .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(deleteSunday))
                                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(17, 17, 17)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel7)
                                    .addComponent(addThursday))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(addStandardList))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(88, 88, 88)
                                        .addComponent(addFriday)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(deleteStandard)
                                                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(jLabel9)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(60, 60, 60)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addGap(10, 10, 10)
                                                .addComponent(jLabel5)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 98, Short.MAX_VALUE)
                                                .addComponent(jLabel8)
                                                .addGap(34, 34, 34))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(addSaturday)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 64, Short.MAX_VALUE)
                                                .addComponent(addSunday)
                                                .addGap(24, 24, 24))))))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(66, 66, 66)
                        .addComponent(jLabel2)
                        .addGap(102, 102, 102)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(99, 99, 99)
                                .addComponent(jLabel4))
                            .addComponent(addWednesday, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addGap(241, 241, 241)
                        .addComponent(jLabel6)))
                .addContainerGap(137, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(storeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addGap(18, 18, 18)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(item1Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel11))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(item2Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel12))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(item3Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel13))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(item4Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel14)))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(addStandardList)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(deleteStandard)))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(clearButton)
                        .addGap(27, 27, 27)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(addTuesday)
                            .addComponent(addWednesday)
                            .addComponent(addMonday)
                            .addComponent(addThursday)
                            .addComponent(addFriday)
                            .addComponent(addSaturday))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(addSunday)
                        .addGap(14, 14, 14)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(deleteSaturday)
                    .addComponent(deleteSunday)
                    .addComponent(deleteFRrday)
                    .addComponent(deleteThursday)
                    .addComponent(deleteWednesday)
                    .addComponent(deleteTuesday)
                    .addComponent(deleteMonday))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void storeFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_storeFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_storeFieldActionPerformed

    private void addMondayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addMondayActionPerformed
        List<String> groceries = new ArrayList<String>();
     groceries.add(storeField.getText());
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

     String s = (String) standardList.getSelectedValue();
     if (s != null)
     {
        groceries.add(s);
     }
     
     ctrl.getMonday(groceries);
    }//GEN-LAST:event_addMondayActionPerformed

    private void addTuesdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addTuesdayActionPerformed
          List<String> groceries = new ArrayList<String>();
     groceries.add(storeField.getText());
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

     String s = (String) standardList.getSelectedValue();
     if (s != null)
     {
        groceries.add(s);
     }
     
     ctrl.getTuesday(groceries);


    }//GEN-LAST:event_addTuesdayActionPerformed

    private void addWednesdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addWednesdayActionPerformed
       List<String> groceries = new ArrayList<String>();
      groceries.add(storeField.getText());
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

     String s = (String) standardList.getSelectedValue();
     if (s != null)
     {
        groceries.add(s);
     }
     
     ctrl.getWednesday(groceries);




    }//GEN-LAST:event_addWednesdayActionPerformed

    private void addThursdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addThursdayActionPerformed

          List<String> groceries = new ArrayList<String>();
      groceries.add(storeField.getText());
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

     String s = (String) standardList.getSelectedValue();
     if (s != null)
     {
        groceries.add(s);
     }

     ctrl.getThursday(groceries);


    }//GEN-LAST:event_addThursdayActionPerformed

    private void addFridayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFridayActionPerformed
   List<String> groceries = new ArrayList<String>();
      groceries.add(storeField.getText());
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

     String s = (String) standardList.getSelectedValue();
     if (s != null)
     {
        groceries.add(s);
     }
     
     ctrl.getFriday(groceries);

    }//GEN-LAST:event_addFridayActionPerformed

private void addSaturdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addSaturdayActionPerformed

      List<String> groceries = new ArrayList<String>();
      groceries.add(storeField.getText());
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

     String s = (String) standardList.getSelectedValue();
     if (s != null)
     {
        groceries.add(s);
     }

     ctrl.getSaturday(groceries);

}//GEN-LAST:event_addSaturdayActionPerformed

private void addSundayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addSundayActionPerformed
      List<String> groceries = new ArrayList<String>();
     groceries.add(storeField.getText());
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

     String s = (String) standardList.getSelectedValue();
     if (s != null)
     {
        groceries.add(s);
     }

     ctrl.getSunday(groceries);
}//GEN-LAST:event_addSundayActionPerformed

private void deleteMondayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteMondayActionPerformed
    String s = (String) mondayList.getSelectedValue();
     ctrl.removeMonday(s);
}//GEN-LAST:event_deleteMondayActionPerformed

private void deleteTuesdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteTuesdayActionPerformed
 String s = (String) tuesdayList.getSelectedValue();
     ctrl.removeTuesday(s);

}//GEN-LAST:event_deleteTuesdayActionPerformed

private void deleteWednesdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteWednesdayActionPerformed
    String s = (String) wednesdayList.getSelectedValue();
     ctrl.removeWednesday(s);
}//GEN-LAST:event_deleteWednesdayActionPerformed

private void deleteThursdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteThursdayActionPerformed
    String s = (String) ThursdayList.getSelectedValue();
     ctrl.removeThursday(s);
}//GEN-LAST:event_deleteThursdayActionPerformed

private void deleteFRrdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteFRrdayActionPerformed
   String s = (String) fridayList.getSelectedValue();
     ctrl.removeFriday(s);
}//GEN-LAST:event_deleteFRrdayActionPerformed

private void deleteSaturdayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSaturdayActionPerformed
   String s = (String) saturdayList.getSelectedValue();
     ctrl.removeSaturday(s);
}//GEN-LAST:event_deleteSaturdayActionPerformed

private void deleteSundayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSundayActionPerformed
    String s = (String) sundayList.getSelectedValue();
     ctrl.removeSunday(s);
}//GEN-LAST:event_deleteSundayActionPerformed

private void addStandardListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStandardListActionPerformed
     List<String> groceries = new ArrayList<String>();
     
     groceries.add(item1Field.getText());
     groceries.add(item2Field.getText());
     groceries.add(item3Field.getText());
     groceries.add(item4Field.getText());

        
     ctrl.getStandard(groceries);

}//GEN-LAST:event_addStandardListActionPerformed

private void deleteStandardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteStandardActionPerformed
    String grocery = (String) standardList.getSelectedValue();
     ctrl.removeStandardGrocery(grocery);
}//GEN-LAST:event_deleteStandardActionPerformed

private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed
storeField.setText("");
item1Field.setText("");
item2Field.setText("");
item3Field.setText("");
item4Field.setText("");

}//GEN-LAST:event_clearButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JList ThursdayList;
    private javax.swing.JButton addFriday;
    private javax.swing.JButton addMonday;
    private javax.swing.JButton addSaturday;
    private javax.swing.JButton addStandardList;
    private javax.swing.JButton addSunday;
    private javax.swing.JButton addThursday;
    private javax.swing.JButton addTuesday;
    private javax.swing.JButton addWednesday;
    private javax.swing.JButton clearButton;
    private javax.swing.JButton deleteFRrday;
    private javax.swing.JButton deleteMonday;
    private javax.swing.JButton deleteSaturday;
    private javax.swing.JButton deleteStandard;
    private javax.swing.JButton deleteSunday;
    private javax.swing.JButton deleteThursday;
    private javax.swing.JButton deleteTuesday;
    private javax.swing.JButton deleteWednesday;
    private javax.swing.JList fridayList;
    private javax.swing.JTextField item1Field;
    private javax.swing.JTextField item2Field;
    private javax.swing.JTextField item3Field;
    private javax.swing.JTextField item4Field;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JList mondayList;
    private javax.swing.JList saturdayList;
    private javax.swing.JList standardList;
    private javax.swing.JTextField storeField;
    private javax.swing.JList sundayList;
    private javax.swing.JList tuesdayList;
    private javax.swing.JList wednesdayList;
    // End of variables declaration//GEN-END:variables

    public void update(Observable o, Object arg) {
       updateShopping();
       System.out.println("shopping virker");
   
    }
public void updateShopping(){
  DefaultListModel list = ctrl.getMondayList();
    mondayList.setModel(list);
  /*  DefaultListModel list = ctrl.getMondayStandard();
    mondayList.setModel(list);*/
   DefaultListModel nlist = ctrl.getTuesdayList();
    tuesdayList.setModel(nlist);
     DefaultListModel wlist = ctrl.getWednesdayList();
    wednesdayList.setModel(wlist);
    DefaultListModel thlist = ctrl.getThursdayList();
    ThursdayList.setModel(thlist);
   DefaultListModel flist = ctrl.getFridayList();
    fridayList.setModel(flist);
     DefaultListModel slist = ctrl.getSaturdayList();
    saturdayList.setModel(slist);
    DefaultListModel sulist = ctrl.getSundayList();
    sundayList.setModel(sulist);
    DefaultListModel stlist = ctrl.getStandardList();
    standardList.setModel(stlist);
      repaint();

     
}

}
